<extend name="desktop_default/template/base_index2" />

<block name="area_header">

</block>

<block name="area_body">
	<include file="desktop_default/width/right" />
	<include file="desktop_default/width/top"/>
	<div class="container">
		{:W('Partials/nav_group')}
	</div><br>
    <include file="desktop_default/partial/usercenter_top"/>

    <div class="div_main shop-container am-cf">
        <div class="div_left" >
            <include file="desktop_default/width/list"/>
        </div>
        <div class="div_right" >
			<font size="5">资金管理</font><hr>
			<span>可用余额：<font size="6" id="coin" color="orangered">{$wallet.account_balance}</font>元</span>
			<span style="margin-left: 30px;">冻结金额：<font size="6" color="orangered">{$wallet.frozen_funds}</font>元</span>
			<div style="float: right; margin-top: 20px;">绑定手机：{$phone}<a style="color: orangered;" href="">[修改]</a></div><br><br>
				<button style="margin-left: 60%;" type="button" class="am-btn-primary" data-am-modal="{target: '#doc-modal-1', closeViaDimmer: 0, width: 500, height: 255}">支付宝提现</button>
				<button style="margin-left: 50px;" type="button" class="am-btn-danger" data-am-modal="{target: '#doc-modal-2', closeViaDimmer: 0, width: 500, height: 355}">银行卡提现</button>
				<hr>
			<div >
				<empty name="wallet_his">
					<h1 style="margin-left: 40%; margin-top: 20px;">暂无交易记录</h1>
					<else/>
					<table width="100%" style="padding: 10px; text-align: center;">
						<tr class="bt" style="border-bottom: 1px solid #F5F5F5;">
							<td width="10%">纪录ID</td>
							<td width="10%">变动之前金额</td>
							<td width="30%">变动之后金额</td>
							<td width="20%">变动时间</td>
						</tr>
						<volist name="wallet_his" id="vo">
						<tr class="jl" style="border-bottom: 1px solid #F5F5F5;">
							<td>{$vo.id}</td>
                            <td >
                                {$vo.before_money}
                            </td>
                            <td >
                                {$vo.after_money}
                            </td>
							<td >{$vo.create_time|date='Y-m-d H:i:s',###}</td>
						</tr>
						</volist>
					</table>
				
					
				</empty>
			</div>
			<!--添加地址-->
			<div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-1">
				<div class="am-modal-dialog">
					<div class="am-modal-hd" style="color: orangered;">支付宝提现
						<a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
					</div>
					<div class="am-modal-bd" style="text-align: left;">
						<form class="fm"  method="post">
							<input type="hidden" name="type" id="type" value="1" />
							<input type="hidden" name="uid" id="uid" value="{$user.id}" />
						<table style="margin-left: 56px;">
							<tr>
								<td>支付宝账号：</td>
								<td><input type="text" name="unum" id="unum" value="" /></td>
							</tr>
							
							<tr>
								<td>收款人姓名：</td>
								<td>
								<input type="text" name="uname" id="uname" value="" /></td>
							</tr>
							<tr>
								<td >提现金额：</td>
								<td>
									<input type="text" name="price" id="uprice" value="" />
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<button type="button" url="{:U('Shop/User/moneymanager')}" target-form="fm" id="ok" style="width: 100px; margin-left: 100px; font-size: 15px;" class="ajax-post am-btn-warning">提交审核</button>
								</td>
							</tr>
						</table>
						</form>
					</div>
				</div>
			</div>
			<!--修改地址-->
			<div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-2">
				<div class="am-modal-dialog">
					<div class="am-modal-hd" style="color: orangered;">银行卡提现
						<a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
					</div>
					<div class="am-modal-bd" style="text-align: left;">
						<form class="fm2" method="post">
							<input type="hidden" name="type" id="type" value="2" />
						<table style="margin-left: 56px;">
							<tr>
								<td>开户行：</td>
								<td><select name="bank">
										<option value="">请选择</option>
										<option value="招商银行">招商银行</option>
										<option value="工商银行">工商银行</option>
										<option value="建设银行">建设银行</option>
										<option value="兴业银行">兴业银行</option>
										<option value="农业银行">农业银行</option>
										<option value="邮政储蓄">邮政储蓄</option>
										<option value="交通银行">交通银行</option>
										<option value="广东发展银行">广东发展银行</option>
										<option value="中信银行">中信银行</option>
										<option value="光大银行">光大银行</option>
										<option value="民生银行">民生银行</option>
										<option value="浦发银行">浦发银行</option>
										<option value="中国银行">中国银行</option>
										<option value="农村信用社">农村信用社</option>
										<option value="北京银行">北京银行</option>
										<option value="平安银行">平安银行</option>
										<option value="农村商业银行">农村商业银行</option>
										<option value="广东南粤银行">广东南粤银行</option>
										<option value="上海银行">上海银行</option>
									</select><br>
								</td>
							</tr>
							<tr>
								<td>持卡人：</td>
								<td><input type="text" name="uname" id="name" value="" /></td>
							</tr>
							<tr>
								<td>开户信息：</td>
								<td><select id="loc_province" style="width:80px;">
										<volist name="pro" id="vo">
											<option value="{$vo['provinceid']}">{$vo['province']}</option>
										</volist>
									</select>
									<input type="hidden" name="sheng" class="sheng" />
									<input type="hidden" name="shi" class="shi" />
									<select id="loc_city" style="width:80px; margin-left: 10px">
									</select>
								</td>
							</tr>
							<tr>
								<td>银行账号：</td>
								<td><input type="tel" name="unum" id="num" value="" /></td>
							</tr>
							<tr>
								<td >提现金额：</td>
								<td>
									<input type="text" name="price" id="price" value="" />
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<button type="button" url="{:U('Shop/User/moneymanager')}" target-form="fm2" id="ok2" style="width: 100px; margin-left: 100px; font-size: 15px;" class="ajax-post am-btn-warning">提交审核</button>
								</td>
							</tr>
						</table>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	 <include file="desktop_default/width/floor" />
	<hr  style="border: none; clear:both"/>
</block>

<block name="area_footer">
<script type="text/javascript">
		$('#loc_province').change(function(){
			$.getJSON("{:U('Shop/User/getcity')}",{sno:$('#loc_province option:selected').val()},function(json){ 
				$('#loc_city').empty();
				for (var a=0;a<json.length;a++) {
					$('#loc_city').append("<option value='"+json[a].cityid+"'>"+json[a].city+"</option>");
				}
			}); 
			var sheng=$('#loc_province option:selected').text();
			$('.sheng').val(sheng);
		})
		$('#loc_city').change(function(){
			var sheng=$('#loc_city option:selected').text();
			$('.shi').val(sheng);
		})
		$('#uprice').blur(function(){
			var coin=Number($('#coin').text());
			if($(this).val()>coin || isNaN($(this).val())){
				alert('请填写有效余额!');
				$(this).val('0.00');
			}
		})
		$('#price').blur(function(){
			var coin=Number($('#coin').text());
			if($(this).val()>coin || isNaN($(this).val())){
				alert('请填写有效余额!');
				$(this).val('0.00');
			}
		})
		
</script>
</block>